all:test

#CXX=CC 
CXX=mpic++ 
CXXFLAGS=-g
#CXXFLAGS=-o2 -fast

simpleFFT.o: simpleFFT.h simpleFFT.c Complex.h
	$(CXX) $(CXXFLAGS) -c -o simpleFFT.o simpleFFT.c

FFTEngine.o: FFTEngine.h FFTEngine.cpp CommLayer.h Complex.h
	$(CXX) $(CXXFLAGS) -c -o FFTEngine.o FFTEngine.cpp

BlockedRadix.o: BlockedRadix.h BlockedRadix.cpp FFTEngine.h CommLayer.h Complex.h
	$(CXX) $(CXXFLAGS) -c -o BlockedRadix.o BlockedRadix.cpp

TransRadix.o: TransRadix.h TransRadix.cpp FFTEngine.h CommLayer.h Complex.h
	$(CXX) $(CXXFLAGS) -c -o TransRadix.o TransRadix.cpp

AllToAllBench.o: AllToAllBench.h AllToAllBench.cpp FFTEngine.h CommLayer.h Complex.h
	$(CXX) $(CXXFLAGS) -c -o  AllToAllBench.o  AllToAllBench.cpp

BinExBench.o: BinExBench.h BinExBench.cpp FFTEngine.h CommLayer.h Complex.h
	$(CXX) $(CXXFLAGS) -c -o  BinExBench.o  BinExBench.cpp

CommLayer.o: CommLayer.h CommLayer.cpp
	$(CXX) $(CXXFLAGS) -c -o CommLayer.o CommLayer.cpp

test.exe: test.c Complex.h simpleFFT.o CommLayer.o FFTEngine.o BlockedRadix.o TransRadix.o AllToAllBench.o BinExBench.o
	$(CXX) $(CXXFLAGS) simpleFFT.o CommLayer.o FFTEngine.o BlockedRadix.o TransRadix.o BinExBench.o AllToAllBench.o test.c -o test.exe

test: test.exe
	./test.exe

clean : 
	rm -f test.exe *.o

pbs : test.exe
	mv distFFT.* ./jobFiles/
	qsub job.pbs
